const mysql = require('mysql');
var client = mysql.createConnection({
    host: 'localhost',
    user: 'root',
    password: '',
    database: 'tingyu'
})

function sqlFn(sql, arr, callback) {
    client.query(sql, arr, (error, result) => {
        if (error) {
            console.log(error);
            return;
        }
        callback(result);
    })
}

module.exports = sqlFn;